﻿using System;

using System.IO;
using System.Linq;
using System.Threading.Tasks;

namespace SteamMoverWPF
{
    public class Game
    {
        public String Name { get; set; }
        public System.IO.DirectoryInfo MainLocation { get; set; }
        public System.IO.DirectoryInfo AlternateLocation
        {
            get
            {
                return IsJunction ?
                    new DirectoryInfo(JunctionPoint.GetTarget(MainLocation.FullName))
                    : null;
            }

            private set { }
        }

        public bool IsJunction
        {
            get
            {
                return MainLocation.Attributes.HasFlag(FileAttributes.ReparsePoint);
            }

            private set { }
        }

        public long Size { get; set; }
        public String SizeInMB { get { return (Size / (1024.0 * 1024.0 )).ToString("0.00"); } }
        public bool IsBeingMoved { get; set; }
        public bool IsQueued { get; set; }

        public override string ToString()
        {
            return Name;
        }
    }
}
